import java.io.*;

public class ExecTest {
    static public void main(String [] args) throws Exception {
        Runtime r = Runtime.getRuntime();

        Process p = r.exec("mplayer /kyo/video/h_170510_io/1_file.mp4 -slave -quiet -input file=/dev/shm/fifo");
        // Process p = r.exec("cat");

        /*
         * BufferedWriter bw = null;
         * bw = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
         * bw.write("hello world cat", 0, 15);
         * bw.flush();
         * bw.close();
         */

        BufferedReader br = null;
        br = new BufferedReader(new InputStreamReader(p.getInputStream()));

        String s = null;
        while ((s = br.readLine()) != null) {
            System.out.println(s);
        }
    }
}
